package homework;

import java.util.Random;

//65 90 97 122  48 57
public class Test10 {
    public static void main(String[] args) {
        Random random=new Random();
        int[] a=new int[4];
        for (int i= 0; i < 4; i++) {
            switch (random.nextInt(3)+1){
                case 1:a[i]=random.nextInt(26)+65;break;
                case 2:a[i]=random.nextInt(26)+97;break;
                case 3:a[i]=random.nextInt(10)+48;break;
            }
        }
        toChar(a);
    }
    public static void toChar(int[] ints){
        System.out.print("验证码为:");
        for (int i = 0; i < ints.length; i++) {
            char[] chars=new char[ints.length];
            chars[i]=(char)ints[i];
            System.out.print(chars[i]);
        }
    }
}